<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.ama.utils.SpringUtils" %>
<%@ page import="com.ama.service.StaffService" %>
<%@ page import="com.ama.pojo.Staff" %>
<%@ page import="com.ama.service.impl.StaffServiceImpl" %>
<%@ page import="java.util.List" %>
<script type="text/javascript" src="../js/pro_pageJS/p_staffDeleteCheck.js"></script>
<script type="text/javascript" src="../js/pro_pageJS/p_staffSearch.js"></script>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>员工管理</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/materialdesignicons.min.css" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.min.css" rel="stylesheet">
    <link href="../js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
</head>

<%
    StaffService staffService = SpringUtils.getBean(StaffServiceImpl.class);
    List<Staff> staffs = staffService.selectAll();
%>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">

                    <div class="container-fluid p-t-15">
                        <div class="row">
                            <div class="col-lg-12">
                                <div class="card">

                                    <%--查询框--%>
                                    <div id="toolbar" class="toolbar-btn-action">
                                        <div class="row m-b-10">
                                            <div class="col-lg-2">
                                                <div class="input-group">
                                                    <span class="input-group-btn">
                                                      <button class="btn btn-primary m-r-5" type="button"
                                                              onclick="staffSearch();">
                                                          查询
                                                      </button>
                                                    </span>
                                                    <input id="search_value" type="text" class="form-control"
                                                           placeholder="请输入ID">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class=" text-center"><h4>员工信息</h4></div>
                                    <div class="card-body">

                                        <form id="staffManageForm" action="/deleteStaff" method="post" class="guide-box"
                                              data-navigateable="true">

                                            <!--对应内容-->
                                            <div class="nav-step-content">
                                                <div class="fixed-table-container" style="padding-bottom: 0px;">
                                                    <div class="fixed-table-header" style="display: none;">
                                                        <table></table>
                                                    </div>
                                                    <div class="fixed-table-body">
                                                        <div class="fixed-table-loading table table-bordered table-hover table-striped"
                                                             style="top: 44px; display: none;">
                                                            <span class="loading-wrap">
                                                            <span class="loading-text">正在努力地加载数据中，请稍候</span>
                                                            <span class="animation-wrap"><span
                                                                    class="animation-dot"></span></span>
                                                            </span>
                                                        </div>
                                                        <table id="tb_departments"
                                                               class="table table-bordered table-hover table-striped">
                                                            <thead class="">
                                                            <tr>
                                                                <th class="bs-checkbox " style="width: 36px; "
                                                                    data-field="0">
                                                                    <div class="th-inner "><label
                                                                            class="lyear-radio radio-primary"></label>
                                                                    </div>
                                                                </th>
                                                                <th style="" data-field="id">
                                                                    <div class="th-inner sortable both">ID</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="author">
                                                                    <div class="th-inner ">员工姓名</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="nationality">
                                                                    <div class="th-inner ">性别</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="status">
                                                                    <div class="th-inner ">手机号</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="status">
                                                                    <div class="th-inner ">身份证号</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="status">
                                                                    <div class="th-inner ">住址</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="operate">
                                                                    <div class="th-inner ">学历</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="operate">
                                                                    <div class="th-inner ">结婚</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                                <th style="" data-field="operate">
                                                                    <div class="th-inner " align="center">操作</div>
                                                                    <div class="fht-cell"></div>
                                                                </th>
                                                            </tr>
                                                            </thead>

                                                            <tbody>
                                                            <%
                                                                for (Staff staff : staffs) {
                                                            %>
                                                            <tr class="">
                                                                <td class="bs-checkbox ">
                                                                    <label class=" lyear-radio radio-primary ">
                                                                        <input data-index="0" name="staff"
                                                                               type="radio"
                                                                               value="<%=staff.getStaffId()%>">
                                                                        <span></span>
                                                                    </label></td>
                                                                <td style=""><%=staff.getStaffId()%>
                                                                </td>
                                                                <td style=""><%=staff.getStaffName()%>
                                                                </td>
                                                                <td style=""><%=staff.getGender()%>
                                                                </td>
                                                                <td style=""><%=staff.getStaffPhone()%>
                                                                </td>
                                                                <td style=""><%=staff.getIdentity()%>
                                                                </td>
                                                                <td style=""><%=staff.getStaffAddress()%>
                                                                </td>
                                                                <td style=""><%=staff.getEducation()%>
                                                                </td>
                                                                <td style=""><%=staff.getMarriage()%>
                                                                </td>
                                                                <td style="">
                                                                    <a type="button" class="btn btn-default"
                                                                       href="p_staffdetail.jsp?staffId=<%=staff.getStaffId()%>">
                                                                        修改信息
                                                                    </a>
                                                                </td>
                                                                    <%}%>

                                                            </tbody>

                                                        </table>
                                                    </div>
                                                    <div class="fixed-table-footer" style="display: none;">
                                                        <table>
                                                            <thead>
                                                            <tr></tr>
                                                            </thead>
                                                        </table>
                                                    </div>
                                                </div>

                                            </div>
                                            <!--End 对应内容-->
                                            <hr>
                                            <div id="toolbar2" class="toolbar-btn-action">
                                                <a id="btn_edit" type="button" class="btn btn-success m-r-5"
                                                   href="p_staffmanage_add.jsp">
                                                    新增
                                                </a>
                                                <%--                                                                    <button id="btn_ban" type="button" class="btn btn-warning m-r-5">--%>
                                                <%--                                                                        <a style="color:#ffffff" href="p_staffdetail.jsp?staffId=<%=staff.getStaffId()%>">修改</a>--%>
                                                <%--                                                                    </button>--%>
                                                <button id="btn_delete" type="button" class="btn btn-danger" onclick="p_staffDeleteCheck();">
                                                    删除
                                                </button>
                                            </div>
                                        </form>

                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>

                    <script type="text/javascript" src="../js/jquery.min.js"></script>
                    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
                    <!--向导插件-->
                    <script type="text/javascript" src="../js/jquery.bootstrap.wizard.min.js"></script>

                    <!--对话框-->
                    <script src="../js/jconfirm/jquery-confirm.min.js"></script>
                    <script type="text/javascript" src="../js/main.min.js"></script>
                </div>
            </div>
        </div>


    </div>

</div>


<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" src="js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>

<!--行内编辑插件-->
<link href="js/x-editable/1.5.1/bootstrap3-editable/css/bootstrap-editable.min.css" rel="stylesheet">
<script type="text/javascript" src="js/x-editable/1.5.1/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
<script type="text/javascript" src="js/bootstrap-table/extensions/editable/bootstrap-table-editable.min.js"></script>

<script type="text/javascript" src="js/main.min.js"></script>
</body>
</html>